import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/openeye/app_init.dart';
import 'package:flutter_app/providerlearn/my_page.dart';

main() {
  runApp(const ProviderLearnMain());
  if (Platform.isAndroid) {
    SystemChrome.setSystemUIOverlayStyle(
        const SystemUiOverlayStyle(statusBarColor: Colors.transparent));
  }
}

class ProviderLearnMain extends StatelessWidget {
  const ProviderLearnMain({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
        future: AppInit.init(),
        builder: ( context, snapshot){
      return createAppPage(context,snapshot);
    });
  }

  Widget createAppPage(BuildContext context, AsyncSnapshot snapshot) {
    return  MaterialApp(
      title: "ProviderLearn",
      theme: ThemeData(primarySwatch: Colors.blue),
      routes: {"/":(context)=>const MyPage()},
      initialRoute: "/",
    );
  }
}
